﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace MDI_Form
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
        
        private void button1_Click(object sender, EventArgs e)
        {
            int iNum = 1;
            //for (int i = 0; i < 100; i++)
            //{
                Form2 f2 = new Form2();
                f2.MdiParent = this;
                f2.Text = "Form" + iNum.ToString();
                iNum++;
                f2.Show();
            //}
        }

        private void button2_Click(object sender, EventArgs e)
        {
            label1.Text = ActiveMdiChild.ToString();
        }


    }
}